import VueRouter from 'vue-router'
import Login from '@/pages/Login.vue'
import Registry from '@/pages/Registry.vue'
import Talk from '@/pages/Talk.vue'
import Detail from '@/pages/Detail.vue'
import Admin from '@/pages/Admin.vue'
import Vue from 'vue'

Vue.use(VueRouter)
const routes=[{
	path:"/",
	name: 'Login',
	component: Login
	
},
	{
		path:"/registry",
		name: 'Registry',
		component:function(){
			return import("@/pages/Registry.vue")
		}
	},
	// {
	// 	path:"/talk",
	// 	name: 'Talk',
	// 	component:Talk
	// }
	{
		path:"/detail",
		name: 'Detail',
		component:Detail,
	},
	{
	  path: '/task/:gameType',
	  name: 'Detail',
	  component: () => import('@/pages/Detail.vue'),
	  meta: { requiresAuth: true }
	},
	{
		path:"/login",
		name: 'Login',
		component:Login
	},
	{
		path:"/luffyAdmin",
		name: 'admin',
		component:Admin
	}
]

export const router = new VueRouter({
	mode:"history",
	base:process.env.BASE_URL,
	routes
})
export default router

